#!/usr/bin/env python

import os
import sys
import site

try:
    ESMOND_ROOT = os.environ['ESMOND_ROOT']
except:
    ESMOND_ROOT = os.path.dirname(os.path.abspath(__file__)) + "/.."
    os.environ['ESMOND_ROOT'] = ESMOND_ROOT

if not os.environ.has_key('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'esmond.settings'

pyver = "%d.%d" % (sys.version_info[0], sys.version_info[1])
venv_dir = '%s/lib/python%s/site-packages' % (ESMOND_ROOT, pyver)
site.addsitedir(venv_dir)

import esmond.newdb

application = esmond.newdb.esdb_wsgi("%s/esmond.conf" % ESMOND_ROOT)
